#include"BSTree.h"
void test1()
{
	BSTree<int> b;
	int a[] = { 8, 3, 1, 10, 6, 4, 7, 14, 13 };
	for (auto e : a)
	{
		b.Insert(e);
	}
	b.Inorder();
	/*b.erase(14);
	b.Inorder();
	b.erase(10);
	b.Inorder();*/
	/*b.erase(8);
	b.Inorder();*/
	/*for (auto e : a)
	{
		b.erase(e);
		b.Inorder();
	}*/
	b.erase(6);
	b.Inorder();
}
void test2()
{
	BSTree<int> b;
	int a[] = { 8, 3, 1, 10, 6, 4, 7, 14, 13 };
	for (auto e : a)
	{
		b.RInsert(e);

	}
	b.Inorder();
	int n=b.RFind(6);
	cout << n<<endl;
	for (auto e : a)
	{
		b.RErase(e);
		b.Inorder();
	}
}
int main()
{
	test2();
	return 0;
}